package cn.com.twoke.easyproject.modules.auth.service.impl;

import cn.com.twoke.easyproject.modules.auth.service.UserInfoService;
import cn.com.twoke.easyproject.modules.auth.spi.AuthService;
import cn.com.twoke.easyproject.modules.auth.spi.pojo.LoginUserInfo;
import cn.dev33.satoken.stp.StpUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class UserInfoServiceImpl implements UserInfoService {

    private final AuthService authService;

    @Override
    public LoginUserInfo getCurrentUserInfo() {
        Long loginId = StpUtil.getLoginId(-1L);
        return authService.getLoginUserInfoByUid(loginId);
    }

}
